package com.eva.databuilder.api;

import com.eva.databuilder.biz.TemplateDataBiz;
import com.eva.databuilder.biz.dto.BuildTemplateDataDTO;
import com.eva.framework.common.api.BaseController;
import com.eva.framework.common.model.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@Api(tags = "模板数据接口")
@RestController
@RequestMapping("/template/data")
public class TemplateDataController extends BaseController {

    @Resource
    private TemplateDataBiz templateDataBiz;

    @PostMapping
    @ApiOperation("构建模板数据")
    public ApiResponse<Map<String, Object>> buildTemplateData (@RequestBody BuildTemplateDataDTO dto) {
        return ApiResponse.success(templateDataBiz.build(dto));
    }
}
